package main

import (
	"log"
	"net/http"

	c "test/timer/controller"
	"test/timer/task"
)

func main() {
	task.Flush()

	http.HandleFunc("/list", c.List)
	http.HandleFunc("/add", c.Add)
	http.HandleFunc("/delete", c.Del)
	http.HandleFunc("/status", c.Status)
	http.HandleFunc("/flush", c.Flush)
	http.HandleFunc("/", c.List)

	http.Handle("/static/", http.FileServer(
		http.Dir("./templates/"),
	))

	log.Fatal(http.ListenAndServe(":8080", nil))
}
